package main

import "fmt"

func main() {

	var a int = 10
	var b int = 20

	swap(&a, &b)
	fmt.Print(a, b) // 20 10
}

func swap(x *int, y *int) {
	var temp int
	temp = *x
	*x = *y
	*y = temp
}
